package com.k2.gulimall.auth.service;

import com.k2.common.utils.R;
import com.k2.common.vo.UserRegisterVo;
import com.k2.gulimall.auth.vo.SocialUser;
import com.k2.gulimall.member.entity.MemberEntity;
import com.k2.gulimall.member.entity.MemberLevelEntity;
import com.k2.gulimall.member.entity.MemberLoginLogEntity;
import com.k2.gulimall.member.entity.MemberStatisticsInfoEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.Map;

@Component
@FeignClient(value = "gulimall-member")
public interface MemberService {

    /**
     * 通过用户名、邮箱、手机号查询用户
     * @param member
     * @return
     */
    @PostMapping("/member/member/info/name")
    public R getUserName(@RequestBody MemberEntity member);
    @PostMapping("/member/member/info/email")
    public R getUserEmail(@RequestBody MemberEntity member);
    @PostMapping("/member/member/info/mobile")
    public R getUserMobile(@RequestBody MemberEntity member);
    @PostMapping("/member/member/save")
    public R savemember(@RequestBody MemberEntity member);


    /**
     * 用户登陆信息
     * @RequestBody memberLoginLog
     * @return
     */
    @PostMapping("/member/memberloginlog/addmemberLoginLog")
    public boolean addmemberLoginLog(@RequestBody UserRegisterVo userRegisterVo);
    @GetMapping(value = "/member/member/oauth2/login")
    R oauthLogin(@RequestParam Map<String,String> jsonMap) throws Exception;
    @PostMapping(value = "/member/member/weixin/login")
    R weixinLogin(@RequestParam(value = "accessTokenInfo") String accessTokenInfo);


    /**
     * 用户的信息统计
     * @param memberStatisticsInfo
     * @return
     */
    @PostMapping("/member/memberstatisticsinfo/save")
    public R savememberStatisticsInfo(@RequestBody MemberStatisticsInfoEntity memberStatisticsInfo);
    @PostMapping("/member/memberstatisticsinfo/update")
    public R updatememberStatisticsInfo(@RequestBody MemberStatisticsInfoEntity memberStatisticsInfo);
    @PostMapping("/member/memberstatisticsinfo/info/{id}")
    public R infomemberStatisticsInfo(@PathVariable(value = "id") Long id);
    @PostMapping("/member/memberstatisticsinfo/getMemberId")
    public R getMemberIdToStatisticsInfo(@RequestBody MemberStatisticsInfoEntity memberStatisticsInfo);
    @PostMapping("/member/memberstatisticsinfo/addmemberStatisticsInfo")
    boolean addmemberStatisticsInfo(@RequestBody UserRegisterVo userRegisterVo);

    /**
     *
     * 获取会员默认等级
     *
     */
    @GetMapping("/member/memberlevel/getMemberLevelToDefault")
    R getMemberLevelToDefault();
}
